﻿#region File Header
//-----------------------------------------------------------------------------
// SibLib
//
// Copyright (C) 2010 Julien Villers
// This program is distributed under the terms of the 
// GNU Lesser General Public License (LGPL).
// See Docs/lgpl.txt and Docs/gpl.txt
//
// This file is based on a XNAWiki page.
//-----------------------------------------------------------------------------
#endregion

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SibLib
{
    /// <summary>
    /// This class is a container for extension methods of classes inside M.Xna.F.Graphics package.
    /// </summary>
    public static class GraphicsExtensions
    {
        #region Viewport
        public static Rectangle GetRectangle(this Viewport vp)
        {
            return new Rectangle(vp.X, vp.Y, vp.Width, vp.Height);
        }

        public static Vector2 GetCenter(this Viewport viewPort)
        {
            return new Vector2(viewPort.Width / 2, viewPort.Height / 2);
        }
        #endregion

    }
}
